<template>
	<div>
		Home组件--{{ title }}
		<br />
		<br />

		<button @click="this.$router.push({ path: '/news' })">跳转到新闻</button>

		<br />
		<br />
		<button @click="this.$router.push({ path: '/newscontent',  query:{aid:14} })">跳转到新闻详情 get传值</button>

		<br />
		<br />
		<button @click="this.$router.push({ path: '/newscontent/123'})">跳转到新闻详情 动态路由传值</button>

		<br />
		<br />
		<br />
		<button @click="setTitle">改变title</button>
	</div>
</template>

<script lang="ts">
	import { defineComponent } from "vue";
	let title : string = "我是一个home组件";
	export default defineComponent({
		data() {
			return {
				title,
				userinfo: {
					username: "张三",
				},
				age: 20,
				sex: "男",
			};
		},
		methods: {
			setTitle() : void {
				this.title = "this is title";
			},
		},
	});
</script>

<style lang="scss">
	//cnpm install -D sass-loader node-sass
</style>